<!-- seperator -->
	<div id="seperator">
		<img src="http://news.sina.com.cn/deco/2010/0813/admin_img/arrow-left.gif" />
		<img src="http://news.sina.com.cn/deco/2010/0813/admin_img/arrow-right.gif" style="display: none" />
	</div>

	<!-- content -->
	<div id="content">

		<!-- menu bar -->
		<div id="menubar">
			<ul id="menulist">
				<li id='thread_normal' class="selected">{%ModuleName%}</li>
			</ul>
			<a href="/index.php">论坛后台</a> / {%ModuleName%}</a>
		</div>
		
		<!-- 二级导航栏 -->
		<div id="navbar">
			<span>
			</span>
		</div>
						
		<div class="left_col">
			<div class="cont">
			  <fieldset>
				<form id="search_form" name="search_form" method="get">
				<input type="hidden" name="s" value="{%ModuleUrlName%}"/>
				<input type="hidden" name="a" value="view"/>
				<div class="bottom_col">
                 <select name="_search_field"/>{%Search%}</select> <input type="text" name="_search_keyword" value="{=$smarty.get._search_keyword=}" id="keyword" size="20"/>&nbsp;&nbsp;<input type="submit" class="button" value="搜索">
            	</div>
       			</form>
				</fieldset>
			</div>
			<div id="data_list">
			<div class="bottom_col">
            	<span style="float:left">
                    <label>
                    <input type="submit" class="opt button" data-opt_id="{%ModuleUrlName%}_update_dialog" data-opt_type="dialog" data-opt_width="520"  data-opt_action="{%CreateAction%}" alt="添加{%ModuleName%}" title="添加{%ModuleName%}"  value="添加{%ModuleName%}"> 
                    <input type="button" class="opt button" data-opt_id='refresh' url='http://{=$smarty.server.HTTP_HOST=}{=$smarty.server.REQUEST_URI=}' value="刷新">
                    </label>
      			</span> 
				<table><tr><td>{=$pageStr=}&nbsp;</td><td> {=if $pageJump=}跳转到{=$pageJump=}{=/if=}</td></tr></table>
				<table class="list_table">
					<thead>
                        {%theader%}
					</thead>
				
				 <tbody id="sortable_tbody" style='table-layout: fixed;'>
				{=foreach from=$data item=item=}
					{%tbody%}
               	{=/foreach=} 
				</tbody>
                <thead>
					{%theader%}
				 </thead>
                </table>

			<div class="bottom_col">
				
                    	<table><tr><td>{=$pageStr=}&nbsp;</td><td> {=if $pageJump=}跳转到{=$pageJump=}{=/if=}</td></tr></table>
						
				</div>
			</div>
		</div>

<!--form start-->
{%Form%}
<!--form end-->


<script type="text/javascript">


function beginOpt(obj) {
	
	switch (obj.data('opt_id')) {
		//刷新
		case 'refresh':
			reloadList(obj.attr('url'));
			return false;
		break;
		case '{%ModuleUrlName%}_delete':
			if(!confirm('确定要删除么？')) {
				return false;
			}
		break;
	}
	return true;
}
function endOpt(obj, data) {
	switch (obj.data('opt_id')) {
		//更新
		case '{%ModuleUrlName%}_update_dialog':
			if (data.result.status.code == '0') {
				var result = data.result.data;
				for (var i in result) {
					obj.parent('td').parent('tr').find('.td_' + i).html(result[i]);
				}
			}
		break;
		//删除
		case '{%ModuleUrlName%}_delete':
			if (data.result.status.code == '0') {
				obj.parent('td').parent('tr').addClass('del');
				//reloadList('http://{=$smarty.server.HTTP_HOST=}{=$smarty.server.REQUEST_URI=}');
			}
		break;
		//逻辑删除
		case '{%ModuleUrlName%}_logic_delete':
			if (data.result.status.code == '0') {
				obj.data('opt_id', obj.data('opt_id').replace('logic_delete', 'logic_resume'));
				obj.data('opt_url', obj.data('opt_url').replace('logic_delete', 'logic_resume'));
				obj.attr('alt', obj.attr('alt').replace('删除', '恢复'));
				obj.attr('title', obj.attr('title').replace('删除', '恢复'));
				obj.parent('td').parent('tr').addClass('del');
				obj.html('恢复');
			}
		break;
		//逻辑恢复
		case '{%ModuleUrlName%}_logic_resume':
			if (data.result.status.code == '0') {
				obj.data('opt_id', obj.data('opt_id').replace('logic_resume', 'logic_delete'));
				obj.data('opt_url', obj.data('opt_url').replace('logic_resume', 'logic_delete'));
				obj.attr('alt', obj.attr('alt').replace('恢复', '删除'));
				obj.attr('title', obj.attr('title').replace('恢复', '删除'));
				obj.parent('td').parent('tr').removeClass('del');
				obj.html('删除');
			}
		break;
	}
			
	return true;
}

function endGetData(obj, data) {
    switch (obj.data('opt_id')) {
		case '***':
			//do samething;
		break;
    }
    return true;
}
</script>
<!-- footer -->
